package stuSystem.biz.impl;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import stuSystem.biz.StandardBiz;
import stuSystem.dao.StandardDao;
import stuSystem.entity.Standard;

public class StandardBizImpl implements StandardBiz {
	
	private StandardDao standardDao;
	public void setStandardDao(StandardDao standardDao) {
		this.standardDao = standardDao;
	}

	@Override
	public List<Standard> getInfoByKeys(String text, int pageNum, int pageSize) {
		return standardDao.getInfoByKeys(text, pageNum, pageSize);
	}

	@Override
	public Standard checkExists(String std_num) {
		return standardDao.checkExists(std_num);
	}

	@Override
	public Standard fetchById(int id) {
		return standardDao.fetchById(id);
	}

	@Override
	public int getRows(String keys) {
		return standardDao.getRows(keys);
	}

	@Override
	public void add(Standard standard) {
		standardDao.add(standard);
	}

	@Override
	public void update(Standard standard) {
		standardDao.update(standard);
	}

	@Override
	public void delete(int id) {
		standardDao.delete(id);
	}

	public static void main(String[] args) {
		ApplicationContext atx = new ClassPathXmlApplicationContext("beans.xml");
		StandardBiz dao = (StandardBiz) atx.getBean("standardBiz");
		System.out.println(dao.checkExists("GB 6657.3-2014"));
	}
}
